package com.design03_behavioral.pattern15_strategy.example01;

/**
 * @ClassName Context
 * @Description TODO
 * @Author zhangjunhao
 * @DATE 2023/9/7 0:32
 */
public class Context {


    //维持一个对抽象策略类的引用
    private Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }


    //调用策略类中的算法
    public void algorithm(){
        strategy.algorithm();
    }


}
